setWatermark Method
Syntax
obj.setWatermark(watermark)
Arguments
- watermarkstring
The text to display for the watermark.
Description
Dynamically change the watermark text for a control that supports watermarks.
Discussion
A new method has been added to controls that have a watermark property that allows you do dynamically change the watermark text.
For example, say you have a control called 'LASTNAME' and you want to set its watermark property.
var obj = {dialog.object}.getControl('LASTNAME'); if (obj && obj.setWatermark) { // check object and method exists before calling it obj.setWatermark('Enter your last name'); }
In the case where the watermark text contains international characters, you must use a unicode encoded value. For example, to set the watermark text to 'Prénom', you would use:
var obj = {dialog.object}.getControl('LASTNAME'); if (obj && obj.setWatermark) { // check object and method exists before calling it obj.setWatermark('Pr\u00E9nom'); }
To get the unicode encoded value of a string you can go to the Tools menu when the Web Control panel has focus and select the Open text encoder window menu command. The encoded string contain unicode encoded values of the form {unicode}#### where "####" is the unicode value (e.g. "00E9" or "FFFD") and "{unicode}" is a placeholder for "\u", which you must manually replace.
Limitations
Controls that Support Watermarks Only